<template>
    <div id="app">
        <input type="text" v-model="message">
        <button @click="appendMsg">输出</button>
        <toDoList v-for="(item,index) in arr" :key="index" :index="index" :text="item" @change="textChange"></toDoList>
    </div>
</template>
<script>
import toDoList from './views/Lesson6/list.vue'
    export default{
        components:{
            toDoList
        },
        data(){
            return {
                message:"",
                arr:[]
            };
        },
        methods:{
                appendMsg(){
                    this.arr.push(this.message)
                },
                textChange(text,index){
                    this.$set(this.arr,index,text)
                }
        }
    }
</script>
<style scoped> 

</style>